package com.google.rui.demos.tabhost;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TabHost;
import android.widget.TextView;

import com.google.rui.demos.R;

/**
 *
 * @author china1988s 
 *
 */
public class TabhostMyText2 extends TabActivity {

	private TabHost tabHost=null;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.tabhost_info_2);
		
		tabHost=getTabHost();
//    	tabHost.setup(); 
    	tabHost.addTab(tabHost.newTabSpec("信息")
    			     .setIndicator(createTabView("模块一"))
    	              .setContent(new Intent(this, ActivityA.class))
    	);
    	tabHost.addTab(tabHost.newTabSpec("更多信息")
	             .setIndicator(createTabView("模块二"))
	             .setContent(new Intent(this, ActivityB.class))
	            		
	);
    	
	}

    private View createTabView(String text) {
        View view = LayoutInflater.from(this).inflate(R.layout.tab_indicator, null);
        TextView tv = (TextView) view.findViewById(R.id.tv_tab);
        tv.setText(text);
        return view;
}


}
